package com.daffodil.flowable.entity;

import java.util.Date;

import org.flowable.ui.modeler.domain.Model;

import com.daffodil.core.entity.BaseEntity;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 流程模型信息
 * @author yweijian
 * @date 2021年11月16日
 * @version 1.0
 * @description
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ActCnModel extends BaseEntity<String> {
    private static final long serialVersionUID = -2677512269950239211L;

    private String id;
    
    /** 流程名称 */
    private String modelName;

    /** 流程标识 */
    private String modelKey;

    /** 流程版本 */
    private Integer version;
    
    /** 缩略图 */
    private byte[] thumbnail;
    
    /** 描述 */
    protected String description;
    
    /** 流程数据 */
    protected String modelEditorJson;
    
    /** 创建者 */
    private String createBy;
    
    /** 创建时间 */
    private Date createTime;
    
    /** 租户ID */
    protected String tenantId;

    public ActCnModel() {
        super();
    }

    public ActCnModel(Model model) {
        this.id = model.getId();
        this.modelName = model.getName();
        this.modelKey = model.getKey();
        this.version = model.getVersion();
        this.thumbnail = model.getThumbnail();
        this.description = model.getDescription();
        this.modelEditorJson = model.getModelEditorJson();
        this.createBy = model.getCreatedBy();
        this.createTime = model.getCreated();
        this.tenantId = model.getTenantId();
    }

}
